package com.xposed.aliproxy.activity;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.xposed.aliproxy.R;
import com.xposed.aliproxy.utils.ActivityUtil;

public abstract class BaseActivity extends Activity {
    public Context context;

    public abstract void loadLayout();

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        requestWindowFeature(7);
        loadLayout();
        getWindow().setFeatureInt(7, R.layout.sub_title);
        this.context = this;
        ActivityUtil.addActivity(this);
    }

    public void setTitleStr(String str) {
        ((TextView) findViewById(R.id.sub_title_title)).setText(str);
    }

    public void setTitle(int i) {
        ((TextView) findViewById(R.id.sub_title_title)).setText(i);
    }

    public void setTitleRight(String str, OnClickListener onClickListener) {
        TextView textView = (TextView) findViewById(R.id.title_btn_right1);
        textView.setText(str);
        textView.setVisibility(View.VISIBLE);
        textView.setOnClickListener(onClickListener);
    }
}
